import request from "@/utils/request.js";


/**
 * 获取乡圈列表
 */

export function getCommunityList(page){
	return request.get('circle/list?page='+page)
}

/**
 * 获取帖子详情	
 */

export function getCommunityDetail(id){
	return request.get(`circle/info/${id}`)
}

/**
 * 获取我的乡圈列表
 */

export function getMyCommunity(page){
	return request.get('circle/myList?page='+page)
}


/**
 * 点赞/取消点赞
 */ 

export function userGiveFlag(id){
	return request.post(`circle/give/${id}`)
}

/**
 * 我点赞过的乡圈列表
 */

export function getMyGiveList(page){
	return request.get('circle/myGiveList?page='+page)
}
/**
 * 删除发表的乡圈
 */

export function deleteCommunityItem(id){
	return request.post(`circle/del/${id}`)
}

/**
 * 获取发布的景点列表
 */	

export function getCommunitySpotList(lng,lat){
	return request.get('circle/spotList?lat='+lat+'&lng='+lng)
}

/**
 * 发布乡圈
 */

export function releaseToCommunity(data){
	return request.post('circle/push',data)
}